<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:decorate template="/template/base.xhtml">

	<ui:define name="centro">
	<h:form id="teste" enctype="multipart/form-data">
			<p:growl id="growl" showDetail="true" life="9000"/>  
           
    <p:wizard widgetVar="wiz"  
            flowListener="#{projectWizard.onFlowProcess}" nextLabel="Next" backLabel="Previous">   
      
        <p:tab id="project" title="Project">  
  
            <p:panel header="Project Details">  
              
                
                  
                <h:panelGrid columns="2" columnClasses="label, value" >  
                    <h:outputText value="Name: *" />  
                    <p:inputText required="true" label="Name"  
                            value="#{projectWizard.project.name}" />
                     <p:commandButton value="Create" update="teste"   
                            actionListener="#{projectWizard.createProjectName()}" />                                              
                </h:panelGrid>
                <p:fileUpload fileUploadListener="#{projectWizard.handleFileUpload}"  
			            mode="advanced"   
			            update="teste"  
			            allowTypes="/(\.|\/)(xml)$/"
			            required="true" 
			            label="upload wadl(xml)"
			            />     
            </p:panel> 
            <p:dataTable var="prj" value="#{projectWizard.soapuiProjects}"
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >
		                  <f:facet name="header">  
		                  	 Project 
		        		  </f:facet>     
				        <p:column headerText="Name Project">  
				            <h:outputText value="#{prj.name}" />  
				        </p:column> 
				        <p:column headerText="xml file name">  
				            <h:outputText value="#{projectWizard.nameXml}" />  
				        </p:column>   
             </p:dataTable>   
        </p:tab>  
  
  
       <p:tab id="testSuite" title="Test Suite">  
  
            <p:panel header="Test Suite">  
              
                
                  
                <h:panelGrid columns="2"  columnClasses="label, value" >   
                <h:outputText value="Name Suite: *" />  
                <p:inputText required="true" value="#{projectWizard.testSuite.name}" label="Name Suite" />
                <h:outputText value="Project:" /> 
                 <p:selectOneMenu id="prj" value="#{projectWizard.project}"  converter="projectConverter">
						        <f:selectItem itemLabel="Select" itemValue=""/>
						        <f:selectItems value="#{projectWizard.soapuiProjects}" var="prj" itemLabel="#{prj.name}" itemValue="#{prj}"/>
			     </p:selectOneMenu>
                <p:commandButton value="Create" update="teste"   
                            actionListener="#{projectWizard.interatorComboTestSuite()}" />                                                      
                </h:panelGrid>
                
                <p:dataTable var="prj" value="#{projectWizard.testSuites}"
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >
		                  <f:facet name="header">  
		                  	 Teste Suite  
		        		  </f:facet>     
				        <p:column headerText="Name Project">  
				            <h:outputText value="#{prj.project.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Teste Suite">  
				            <h:outputText value="#{prj.name}" />  
				        </p:column>  
             </p:dataTable>  
               </p:panel> 
        </p:tab>        
        
        <p:tab id="testCase" title="Test Case">  
  
            <p:panel header="Test Case">  
                      
                  
                <h:panelGrid columns="2" columnClasses="label, value">   
                  <h:outputText value="Name Test Case: *" />  
                    <p:inputText required="true" value="#{projectWizard.testCase.name}" label="Name Test Case" />
                   <h:outputText value="Test Suite" /> 
                 <p:selectOneMenu id="tsuites" value="#{projectWizard.testSuite}"  converter="testSuiteConverter">
						        <f:selectItem itemLabel="Select" itemValue=""/>
						        <f:selectItems value="#{projectWizard.testSuites}" var="prj" itemLabel="#{prj.name}" itemValue="#{prj}"/>
			     </p:selectOneMenu>   
             
                     <p:commandButton value="Create" update="teste"   
                            actionListener="#{projectWizard.interatorComboTestCase()}" />                                   
                </h:panelGrid>
                <p:dataTable var="prj" value="#{projectWizard.testCases}"
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >
		                  <f:facet name="header">  
		                  	 Teste Case  
		        		  </f:facet>     
				        <p:column headerText="Name Project">  
				            <h:outputText value="#{prj.testSuite.project}" />  
				        </p:column>  
				  
				        <p:column headerText="Teste Suite">  
				            <h:outputText value="#{prj.testSuite.name}" />  
				        </p:column> 
				        
				         <p:column headerText="Teste Case">  
				            <h:outputText value="#{prj.name}" />  
				        </p:column>  
             </p:dataTable>    
            </p:panel>  
        </p:tab>  
              
        <p:tab id="testStep" title="Test Step">  
            <p:panel header="Project Details">  
              
                  
                  
                <h:panelGrid columns="2" columnClasses="label, value">  
                      
                    <br />
                    <h3>Test Step</h3>
                    <br />
					    <p:panelGrid  columns="2" columnClasses="label, value" styleClass="grid">
					   	   <h:outputText value="Name Project:" />  
                    		<p:selectOneMenu id="idproject" value="#{projectWizard.project.name}"  >
						        <f:selectItem itemLabel="Selecione" itemValue=""/>
						        <f:selectItems value="#{projectWizard.soapuiProjects}" var="testS" itemLabel="#{testS.name}" itemValue="#{testS}"/>
						        <p:ajax update="teste"
                                listener="#{projectWizard.ListAjax()}" />                   
					       </p:selectOneMenu> 
					       <h:outputText value="Suite Test: *" />
				           <p:selectOneMenu id="suiteteste" value="#{projectWizard.testSuite.name}" disabled="true" >
						        <f:selectItem itemLabel="Selecione" itemValue=""/>
						        <f:selectItems value="#{projectWizard.testSuites}" var="testS" itemLabel="#{testS.name}" itemValue="#{testS}"/>
					       </p:selectOneMenu>
					       <h:outputText value="Teste Case: *" />
				           <p:selectOneMenu id="suitecase" value="#{projectWizard.testCase.name}"  disabled="true">
						        <f:selectItem itemLabel="Selecione" itemValue=""/>
						        <f:selectItems value="#{projectWizard.testCases}" var="testC" itemLabel="#{testC.name}" itemValue="#{testC}"/>
					       </p:selectOneMenu>
					       <h:outputText value="Name: *" />
					       <p:inputText required="true" value="#{projectWizard.testStep.name}" label="Name TestStep"/>
					       <h:outputText value="Path: *" />
					       <p:selectOneMenu id="steste" value="#{projectWizard.config.resourcePath}"  >
						        <f:selectItem itemLabel="Selecione" itemValue=""/>
						        <f:selectItems var="item" itemLabel="#{item.path}" itemValue="#{item.path}" value="#{projectWizard.listResources}"/>
						       
			               </p:selectOneMenu>		               		
					       <h:outputText value="Name Method: *" />
					       <p:selectOneMenu id="Nmethod" value="#{projectWizard.config.methodName}"  >
						        <f:selectItem itemLabel="Selecione" itemValue=""/>
						        <f:selectItems var="item" itemLabel="#{item.name}" itemValue="#{item.name}" value="#{projectWizard.listMethods}"/>
						       
			               </p:selectOneMenu>
					       <h:outputText value="MIME Type: *" />
					       <p:selectOneRadio id="options" value="#{projectWizard.restRequest.mediaType}" label="MIME Type">  
					            <f:selectItem itemLabel="XML" itemValue="application/xml" />  
					            <f:selectItem itemLabel="JSON" itemValue="application/json" />  
					            <f:selectItem itemLabel="TEXT" itemValue="application/text" />  
				           </p:selectOneRadio>				             
				           <h:outputText value="Expected StatusCode: *" />
				           <p:selectOneMenu value="#{projectWizard.configuration.codes}" required="true" effect="fade" label="Expected StatusCode">  
					            <f:selectItem itemLabel="Select One" itemValue="" />  
					            <f:selectItem itemLabel="100" itemValue="100" />  
					            <f:selectItem itemLabel="101" itemValue="101" />  
					            <f:selectItem itemLabel="102" itemValue="102" /> 
					            <f:selectItem itemLabel="103" itemValue="103" /> 
					            <f:selectItem itemLabel="122" itemValue="122" /> 
					            <f:selectItem itemLabel="200" itemValue="200" /> 
					            <f:selectItem itemLabel="201" itemValue="201" />
					            <f:selectItem itemLabel="202" itemValue="202" />  
					            <f:selectItem itemLabel="203" itemValue="203" />  
					            <f:selectItem itemLabel="204" itemValue="204" /> 
					            <f:selectItem itemLabel="205" itemValue="205" /> 
					            <f:selectItem itemLabel="206" itemValue="206" /> 
					            <f:selectItem itemLabel="207" itemValue="207" /> 
					            <f:selectItem itemLabel="208" itemValue="208" />
					            <f:selectItem itemLabel="226" itemValue="226" />  
					            <f:selectItem itemLabel="300" itemValue="300" />  
					            <f:selectItem itemLabel="301" itemValue="301" /> 
					            <f:selectItem itemLabel="302" itemValue="302" /> 
					            <f:selectItem itemLabel="303" itemValue="303" /> 
					            <f:selectItem itemLabel="304" itemValue="304" /> 
					            <f:selectItem itemLabel="305" itemValue="305" />
					            <f:selectItem itemLabel="306" itemValue="306" />  
					            <f:selectItem itemLabel="307" itemValue="307" /> 
					            <f:selectItem itemLabel="308" itemValue="308" /> 
					            <f:selectItem itemLabel="400" itemValue="400" /> 
					            <f:selectItem itemLabel="401" itemValue="401" /> 
					            <f:selectItem itemLabel="402" itemValue="402" />
					            <f:selectItem itemLabel="403" itemValue="403" /> 
					            <f:selectItem itemLabel="404" itemValue="404" /> 
					            <f:selectItem itemLabel="405" itemValue="405" />
					            <f:selectItem itemLabel="406" itemValue="406" />  
					            <f:selectItem itemLabel="407" itemValue="407" />  
					            <f:selectItem itemLabel="409" itemValue="409" /> 
					            <f:selectItem itemLabel="410" itemValue="410" /> 
					            <f:selectItem itemLabel="411" itemValue="411" /> 
					            <f:selectItem itemLabel="412" itemValue="412" /> 
					            <f:selectItem itemLabel="413" itemValue="413" />
					            <f:selectItem itemLabel="414" itemValue="414" />  
					            <f:selectItem itemLabel="415" itemValue="415" /> 
					            <f:selectItem itemLabel="416" itemValue="416" /> 
					            <f:selectItem itemLabel="417" itemValue="417" /> 
					            <f:selectItem itemLabel="418" itemValue="418" /> 
					            <f:selectItem itemLabel="420" itemValue="420" />
					            <f:selectItem itemLabel="422" itemValue="422" /> 
					            <f:selectItem itemLabel="423" itemValue="423" /> 
					            <f:selectItem itemLabel="426" itemValue="426" />
					            <f:selectItem itemLabel="406" itemValue="406" />  
					            <f:selectItem itemLabel="428" itemValue="428" />  
					            <f:selectItem itemLabel="429" itemValue="429" /> 
					            <f:selectItem itemLabel="431" itemValue="431" /> 
					            <f:selectItem itemLabel="444" itemValue="444" /> 
					            <f:selectItem itemLabel="449" itemValue="449" /> 
					            <f:selectItem itemLabel="450" itemValue="450" />
					            <f:selectItem itemLabel="451" itemValue="451" />  
					            <f:selectItem itemLabel="499" itemValue="499" /> 
					            <f:selectItem itemLabel="500" itemValue="500" /> 
					            <f:selectItem itemLabel="501" itemValue="501" /> 
					            <f:selectItem itemLabel="502" itemValue="502" /> 
					            <f:selectItem itemLabel="503" itemValue="503" />
					            <f:selectItem itemLabel="504" itemValue="504" />
					            <f:selectItem itemLabel="505" itemValue="505" />  
					            <f:selectItem itemLabel="506" itemValue="506" /> 
					            <f:selectItem itemLabel="507" itemValue="507" /> 
					            <f:selectItem itemLabel="508" itemValue="508" /> 
					            <f:selectItem itemLabel="509" itemValue="509" /> 
					            <f:selectItem itemLabel="510" itemValue="510" />
					            <f:selectItem itemLabel="511" itemValue="511" /> 
					            <f:selectItem itemLabel="598" itemValue="598" /> 
					            <f:selectItem itemLabel="599" itemValue="599" />          
				           </p:selectOneMenu>
				           <h:outputText value="Parameter: *" />
				           <p:selectOneMenu value="#{projectWizard.entry.key}" required="true" label="Parameter">  
					            <f:selectItem itemLabel="Código" itemValue="codigo" />  
					            <f:selectItem itemLabel="Matricula" itemValue="matricula" />    
				           </p:selectOneMenu>
				           <h:outputText value="Parameter Value: *" />
				           <p:inputText value="#{projectWizard.entry.value}" required="true" label="Parameter Value" >
				               <!-- <f:convertNumber integerOnly="true"/>-->
				           </p:inputText>
				           <p:commandButton value="Create Test Step" update="teste"   
                            actionListener="#{projectWizard.tableBuild()}" />
                            
					    </p:panelGrid> 
				                  
                </h:panelGrid> 
            </p:panel>  
             <p:dataTable var="prj" value="#{projectWizard.testSuitesInter}"
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >
		                  <f:facet name="header">  
		                  	 Teste Case  
		        		  </f:facet>     
				        <p:column headerText="Name Project">  
				            <h:outputText value="#{prj.project.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Teste Suite">  
				            <h:outputText value="#{prj.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Test Case">  
				            <h:outputText value="#{prj.testCase.name}" />  
				        </p:column> 
				  
				        <p:column headerText="Test Step">  
				            <h:outputText value="#{prj.testCase.testStep.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Path">  
				            <h:outputText value="#{prj.testCase.testStep.config.resourcePath}" />  
				        </p:column>  
             </p:dataTable>
             
        </p:tab>  
              
       
    </p:wizard>  
		</h:form>
	</ui:define>
	
</ui:decorate>

</html>